package gcj2011.round1b;

import java.util.Arrays;

import common.AbstractRunner;

public class B extends AbstractRunner {

	public void handleCase(int caseNumber) throws Exception {
		int c = scanner.nextInt();
		long d = scanner.nextInt();
		long[] p = new long[1000000];
		//System.out.println(ncases+" "+c+" "+d);
		int n = 0;
		for (int i=0; i<c; i++) {
			long pp = scanner.nextInt();
			int vv = scanner.nextInt();
			for (int j=0; j<vv; j++) {
				p[n++] = pp;
				//System.out.println(p[n-1]);
			}
		}
		Arrays.sort(p, 0, n);
		
		long[] pnew = new long[n];
		pnew[0] = p[0];
		long maxshift = 0;
		for (int i=1; i<n; i++) {			
			pnew[i] = p[i] - pnew[i-1] < d ? pnew[i-1] + d : p[i];
			if (pnew[i] - p[i] > maxshift) {
				maxshift = pnew[i] - p[i];
			}
			//System.out.println(i+":"+p[i]+":"+pnew[i]);
		}
		out.write(maxshift/2.0+"\n"); 
	}

	public static void main(String[] args) throws Exception {
		new B().init(SIZE.large).execute();
	}
		
}
